
function validator(rule, value, callback) {
    if (value == '') {
        callback(new Error('排序不能为空'));
    } else if (!icu.util.jude(value, 'int')) {
        callback()
    } else {
        callback(new Error('只能为正整数'));
    }
}
let config = {
    isShow: true,
    name: 'addOrUpdata',
    labelWidth: 120,
    form: [
        { type: 'treeSelect', key: 'pid', label: '上级字典', data: [], default: '0' },
        { type: 'input', dataType: 'text', key: 'value', label: '字典值', icon: '', disabled: false, placeholder: '字典值', default: '', showwordlimit: true, maxlength: 100 },
        { type: 'input', dataType: 'text', key: 'label', label: '字典标签', icon: '', disabled: false, placeholder: '字典标签', default: '', showwordlimit: true, maxlength: 100, },
        { type: 'input', dataType: 'text', key: 'sort', label: '排序', icon: '', showwordlimit: true, disabled: false, placeholder: '排序', maxlength: 3, default: '' },
        { type: 'input', dataType: 'text', key: 'remarks', label: '备注', icon: '', disabled: false, placeholder: '请输入', default: '', showwordlimit: true, maxlength: 200, },
    ],
    rules: {
        pid: [
            { required: true, message: '请选择', trigger: 'change' }
        ],
        value: [
            { required: true, message: '请输入', trigger: 'blur' }
        ],
        label: [
            { required: true, message: '请输入', trigger: 'blur' }
        ],
        sort: [{ required: true, validator: validator, trigger: 'blur' }],
    },
    grid: {
        xl: 24,
        lg: 24,
        md: 24,
        sm: 24,
        xs: 24
    },
    event: {
        iconInput: () => {
        }
    } // 动态绑定事件
}

export { config }
